# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1292136048.7700419
_template_filename='/Users/joeldunham/old/onlinelinguisticdatabase/templates/derived/collection/results.html'
_template_uri='/derived/collection/results.html'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['heading']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    # SOURCE LINE 3
    ns = runtime.Namespace(u'collectionViews', context._clean_inheritance_tokens(), templateuri=u'/base/collectionViews.html', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, u'collectionViews')] = ns

    # SOURCE LINE 4
    ns = runtime.Namespace(u'javascriptDefs', context._clean_inheritance_tokens(), templateuri=u'/base/javascriptDefs.html', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, u'javascriptDefs')] = ns

def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, u'/base/index.html', _template_uri)
def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        _import_ns = {}
        _mako_get_namespace(context, u'collectionViews')._populate(_import_ns, [u'*'])
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'*'])
        collectionViews = _mako_get_namespace(context, 'collectionViews')
        c = _import_ns.get('c', context.get('c', UNDEFINED))
        len = _import_ns.get('len', context.get('len', UNDEFINED))
        hasattr = _import_ns.get('hasattr', context.get('hasattr', UNDEFINED))
        javascriptDefs = _mako_get_namespace(context, 'javascriptDefs')
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n\n')
        # SOURCE LINE 3
        __M_writer(u'\n')
        # SOURCE LINE 4
        __M_writer(u'\n\n')
        # SOURCE LINE 14
        __M_writer(u'\n\n\n')
        # SOURCE LINE 17
        if hasattr(c, 'browsing'):
            # SOURCE LINE 18
            __M_writer(u' <p>Collections are documents that can represent stories and records of\n elicitations, among other things.  In the body of a Collection, you can refer\n to a Form and thereby embed a representation of it.</p>\n')
            pass
        # SOURCE LINE 22
        __M_writer(u'\n\n')
        # SOURCE LINE 24
        if len(c.paginator):
            # SOURCE LINE 25
            __M_writer(u'\n<p id="paginatorPager">')
            # SOURCE LINE 26
            __M_writer(escape( c.paginator.pager('$link_first $link_previous $first_item to $last_item of $item_count $link_next $link_last') ))
            __M_writer(u'</p>\n\n\n')
            # SOURCE LINE 29
            if not hasattr(c, 'browsing'):
                # SOURCE LINE 30
                __M_writer(u' ')
                __M_writer(escape(javascriptDefs.toggleLabelsJavaScript('fileTableRowLabel')))
                __M_writer(u'\n <a class="buttonLink" id="toggleRowLabelsButton" title="hide labels">-</a>\n')
                pass
            # SOURCE LINE 33
            __M_writer(u'\n\n<div class="tableSpacerDivHalf"></div>\n\n\n')
            # SOURCE LINE 38
            if hasattr(c, 'browsing'):
                # SOURCE LINE 39
                __M_writer(u' <table style="width:100%;">\n  <tr>\n   <th class="onethirdcell">Title</th>\n   <th class="onethirdcell">Date Modified</th>\n   <th class="onethirdcell">Type</th>\n  </tr>\n')
                # SOURCE LINE 45
                for collection in c.paginator:
                    # SOURCE LINE 46
                    __M_writer(u'    ')
                    __M_writer(escape(collectionViews.collectionViewReallyShort(collection)))
                    __M_writer(u'\n')
                    pass
                # SOURCE LINE 48
                __M_writer(u' </table>\n')
                # SOURCE LINE 49
            else:
                # SOURCE LINE 50
                for collection in c.paginator:
                    # SOURCE LINE 51
                    __M_writer(u'    ')
                    __M_writer(escape(collectionViews.collectionViewShort(collection)))
                    __M_writer(u'\n')
                    pass
                pass
            # SOURCE LINE 54
            __M_writer(u'\n\n<p>')
            # SOURCE LINE 56
            __M_writer(escape( c.paginator.pager('~2~') ))
            __M_writer(u'</p>\n\n')
            pass
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_heading(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'collectionViews')._populate(_import_ns, [u'*'])
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'*'])
        c = _import_ns.get('c', context.get('c', UNDEFINED))
        hasattr = _import_ns.get('hasattr', context.get('hasattr', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 6
        __M_writer(u'\n')
        # SOURCE LINE 7
        if hasattr(c, 'browsing'):
            # SOURCE LINE 8
            __M_writer(u'    <h1 class="heading">Collections (')
            __M_writer(escape(c.paginator.item_count))
            __M_writer(u')</h1>       \n')
            # SOURCE LINE 9
        elif c.paginator.item_count == 1:
            # SOURCE LINE 10
            __M_writer(u'    <h1 class="heading">Collection Results: ')
            __M_writer(escape(c.paginator.item_count))
            __M_writer(u' match</h1>\n')
            # SOURCE LINE 11
        else:
            # SOURCE LINE 12
            __M_writer(u'    <h1 class="heading">Collection Results: ')
            __M_writer(escape(c.paginator.item_count))
            __M_writer(u' matches</h1>\n')
            pass
        return ''
    finally:
        context.caller_stack._pop_frame()


